/**
 * Version   		: 1.0
 * File Name        : OracleDAOFactory.java
 * Created By		: ReleaseManger
 * Creation Date	: 23-01-2007
 * Description		: File Contain public class for creating Oracle Connection
 * ReleaseManger CONFIDENTIAL
 */
package com.idm.tacacs.utils;

import java.sql.Connection;
import java.sql.DriverManager;



/**
 * 
 * 
 * Class : DAOFactory
 * DAO Factory class that provides DAOFactory Specific to the MSSQL Connection.
 * 
 * @author ReleaseManger
 * 
 *
 */

public class MSSQLDAOFactory 
{
	
	/**
	 * Method : createConnection()
	 *
	 * Method create connection specific to MSSQL based on the Provided 
	 * DataSource Name that is provided as arguement.
	 *
	 * @param String connectionType
	 * @return Connection
	 * @exception RELEASEException
	 */
	
	public static Connection createConnection() 
	throws TacacsServiceException , TacacsException
	{
		Connection objConnection = null;
		String strMethodName = null;
		String strDataSource = null;
		try{
			
				Class.forName("com.MSSQL.jdbc2.jdbc.SybDriver");
				String dbserver = "jdbc:MSSQL:Tds:STPLT1795:5000";
				String dbname = "sa";
				String password = "";
				System.out.println("dbserver "+dbserver);
				System.out.println(" dbname "+dbname);
				System.out.println("password "+password);
				 objConnection = DriverManager.getConnection(dbserver, dbname, password);
		}
		catch(Exception e)
		{
			System.out.println(e.toString());
			throw new TacacsException(e);		
		}
		return objConnection;
	}
	
}